package io.api.enums;

/**
 * 用户角色
 */
public enum ProjectRole {
    /**
     * 施工人员
     */
    WORKER(1, "施工人员"),
    /**
     * 施工负责人
     */
    HEAD(2, "施工负责人");

    private int value;

    private String description;

    ProjectRole(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static ProjectRole get(int value) {
        for (ProjectRole role : ProjectRole.values()) {
            if (role.ordinal() == value) {
                return role;
            }
        }
        return WORKER;
    }
}
